<?php 
namespace app\home\controller;
use think\Controller;
// use app\home\controller\Common;
/**
* 搜索功能
*/

class Search extends Common
{
	
	public function index(){

		$keywords=input('keywords');
		$serRes=db('article')->order('aid desc')->where('keywords','like','%'.$keywords.'%')->paginate(10,false,$config = ['query'=>array('keywords'=>$keywords)]);

		$this->assign(
			array(
				'serRes'=>$serRes,
				'keywords'=>$keywords,
				)
			);
		return $this->fetch('search');
	}

	

}
